<template>
  <div>
    <div>当前count的值为：{{$store.state.count}}</div>
  <button @click="add">+1</button>
  </div>
</template>
<script>
import { mapActions } from 'vuex'
export default {
  data () {
    return {}
  },
  methods: {
    ...mapActions(['addAsync']),
    add () {
      // this.$store.commit('add', 2)
      // this.$store.dispatch('addAsync')
      // this.$store.dispatch('addAsync', 10)
      this.addAsync(150)
    }
  }
}
</script>
